/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2022-05-15 14:34:32
 * @LastEditors: voanit
 * @LastEditTime: 2022-05-16 10:20:31
 */
import { LOGIN,LOGOUT } from '@/store/actionTypes'
import { getToken } from '@/utils/storage'
const initValue = getToken() || {
  token: '',
}
export default function login(state = initValue, action) {
  switch (action.type) {
    case LOGIN:
      return action.payload
    case LOGOUT:
      return initValue
    default:
      return state
  }
}
